<template>
	<view class="container">
		<!-- 显示的组件 -->
		<u-notify ref="uNotify"></u-notify>
		<boss-send-job v-if="userType==1 && token " :isShowBoss="isShowBoss" :hansBarBottom='hansBarBottom'>
		</boss-send-job>
		<!-- 显示的组件 -->
		<view class="box" v-if="userType!==1">
			<!-- 显示的组件 -->
			<!-- <boss-view v-if="userType==1 && token " :word="word" :isShowBoss="isShowBoss"></boss-view> -->
			<staff-view :word="word" ref="staff" :upLocation="upLocation" :vipFlag="vipFlag" @toParents='toParents'
				:contentMessage='contentMessage' :zimuAutoplay="zimuAutoplay"></staff-view>
			<hans-tabber :indexNum="0" v-if="userType2==1" style="position:fixed;bottom:0;width:100%;left:0;right:0;">
			</hans-tabber>
		</view>
		<!-- 分享海报 -->
		<!-- <view class="modal show" @touchmove.stop.prevent="()=>false" :style=" {display:isShowPost}"
			@click="onConfirmClicks">
			<canvas canvas-id="invitation-post"
				:style="{ width: '810rpx', height: '910rpx', position: 'fixed', top: '-9999px', left: '70rpx'}"></canvas>
			<view class="my-post" :style="{width: PopupWatchImg[2], height: PopupWatchImg[3]}">
				<image class="bg" @click="OnPopupWatch" :src="PopupWatchImg[0]"
					:style="{width: PopupWatchImg[2], height: PopupWatchImg[3]}" mode="aspectFit"></image>
				<image @click="onConfirmClicks" class="close" src="https://images.linglinggong.net/static/icon1/07.png">
				</image>
			</view>
		</view> -->
		<!-- 周冲 -->
		<!-- <view class="modal show" @touchmove.stop.prevent="()=>false" :style=" {display: isShowPost22}"
			@click="onConfirmClicks">
			<canvas canvas-id="invitation-post"
				:style="{ width: '708rpx', height: '805rpx', position: 'fixed', top: '-9999px', left: '70rpx'}"></canvas>
			<view class="my-post" :style="{width: '708rpx', height: '805rpx'}">
				<image class="bg" @click="tochong()" src="https://images.linglinggong.net/XCX/zc.png"
					:style="{width: '708rpx', height: '805rpx'}" mode="aspectFit"></image>
				<image @click="onConfirmClicks" class="close" src="https://images.linglinggong.net/static/icon1/07.png">
				</image>
			</view>
		</view> -->
		<!-- 新人优惠  isNew-->
		<view class="modal show" @touchmove.stop.prevent="()=>false" :style=" {display: isNew}"
			@click="onConfirmClickNew">
			<canvas canvas-id="invitation-post"
				:style="{ width: '708rpx', height: '778rpx', position: 'fixed', top: '-9999px', left: '70rpx'}"></canvas>
			<view class="my-post" :style="{width: '708rpx', height: '778rpx'}">
				<view class="bgNew" @click="toNew()">
					<text>{{countNew}} </text>
				</view>
				<image @click="onCloseNew" class="close" src="https://images.linglinggong.net/static/icon1/07.png">
				</image>
			</view>
		</view>
		<!-- 隐私政策弹框 -->
		<!-- <wyb-modal ref="modal" title="服务协议和隐私政策" @cancel="onCancelClick" @confirm="onConfirmClick" /> -->
		<!-- 账号被限制接单中 -->
		<popupWatch v-if="isShowPw" @closePwPage="closePwPage"></popupWatch>
		<!-- 助力解禁 -->
		<jffuchuang v-if="isFengjin&&isShowPw==false"></jffuchuang>
		<Draggable :y='630' v-if="showToop.whether=='true'">
			<view class="toops zwyShake" @click="toNew">
				<text>
					{{showToop.amount}}
				</text>
			</view>
		</Draggable>
		<!-- 晋升助手 -->
		<Draggable :y='720' v-if="userType==0&&token">
			<view class="helper" @click="clickVideo">晋升助手</view>
		</Draggable>
		<studyVideo v-if='showGrow' @toClose='toClose' :isStydu='userInfo.studyFlag' :video='video'
			:typeVide='typeVide'>
		</studyVideo>
		<bulletBox :showMask='showMask' v-if="!!showMask"></bulletBox>
	</view>
</template>
<script>
	import {
		Registration_activities
	} from '@/libs/unit.js'
	import hansTabber from '../../components/hans-tabbar/hans-tabbar.vue'
	import placeMap from '@/libs/place-map.js'
	import staffView from './staff'
	import bossSendJob from '@/pages/index/send-job/send-job-new'
	import bulletBox from '@/components/bulletBox.vue'
	import {
		baseURL
	} from '@/config'
	import wybModal from '@/components/wyb-modal/wyb-modal.vue'
	import wybModalindex from '@/components/wyb-modal/wyb-modalindex.vue'
	import unit from '../../libs/newUnit.js'
	import popupWatch from '../../components/xjbg/popupWatch.vue'
	import jffuchuang from '../../components/xjbg/jf-fuchuang.vue'
	import studyVideo from '../../components/helpMosk/mosk.vue'
	export default {
		components: {
			staffView,
			// bossView,
			wybModal,
			wybModalindex,
			hansTabber,
			popupWatch,
			jffuchuang,
			studyVideo,
			bossSendJob,
			bulletBox
		},
		provide() {
			return {
				zimuAutoplay: this.zimuAutoplay
			}
		},
		data() {
			return {
				video: '',
				typeVide: 0,
				upLocation: false, //定位授权时更新显示的位置
				token: '',
				userInfo: {
					user: {},
					params: {}
				}, //当前用户信息
				userType: -1, //用户类型0 雇员，1雇主
				word: '', //搜索关键字
				lat: '', //当前用户位置
				lng: '', //当前用户位置
				isShowBoss: 0,
				isShowStaff: 0,
				location: [], //存储的定位
				postUrl: '', //海报
				region: '', //当前区域代码
				isShowPost: 'none', //是否显示海报
				imgPaths: '',
				PopupWatchImg: {
					img: '',
					path: '',
				}, //弹窗图片对象 图片地址 跳转地址 宽 高
				isFullScreen: false, //是否全面屏、刘海屏
				isFengjin: false,
				isShowPw: false,
				hansBarBottom: 0,
				tempTrade: '',
				pagePath: '',
				isShowPost22: 'none',
				vipFlag: '',
				isNew: 'none', //新雇员的活动
				countNew: 0, //新手送多少钱
				showToop: {},
				showGrow: false,
				contentMessage: {},
				userType2: '',
				zimuAutoplay: true,
				showMask: [], //弹框
			}
		},
		onShareAppMessage() {
			if (uni.getStorageSync('userType') == 1) {
				return {
					title: "足不出户，免费招工",
					desc: "线上招募零工，工价透明，免费使用",
					path: `/pages/start-n/start-n`,
					imageUrl: 'https://images.linglinggong.net/static/employer-share.jpg',
					success: res => {}
				}
			} else {
				return {
					title: "在家找日结兼职，工种齐全",
					desc: "免费使用，提前在家找日结兼职",
					path: `/pages/start-n/start-n`,
					imageUrl: 'https://images.linglinggong.net/static/employee-share.jpg',
					success: res => {}
				}
			}
		},
		onLoad() {
			this.userType2 = uni.getStorageSync('userType');
			uni.hideTabBar()
			this.getSetting()
			// uni.showTabBar()
			uni.setStorageSync("systerr", "2")
			this.token = uni.getStorageSync('token')
			if (uni.getStorageSync('token')) {
				let tempTaskId = uni.getStorageSync('y-invitetaskId')
				if (tempTaskId && this.userType2 == 0) {
					uni.navigateTo({
						url: '/pages/job-detail/job-detail?taskId=' + tempTaskId
					})
					// return
				}
				// unit.Closure_time().then(v => {
				// 	this.isFengjin = v.data == 0 ? false : v.data.status == 0 ? true : false
				// 	if (uni.getStorageSync('yajinItem') != '' && v.data.expireTime != uni.getStorageSync(
				// 			'yajinItem').expireTime) {
				// 		unit.Closure_margin()
				// 	}
				// })
				this.getUserInfo() //获取用户信息
				setTimeout(() => {
					this.getUserInfo() //获取用户信息
				}, 60000 * 10)
			}
			// this.get_current_location() //首页经纬度
			//因为抖音小程序对页面的高度没有适配 所以要设置一下底部距离
			// #ifdef MP-TOUTIAO
			uni.getSystemInfo({
				success: res => {
					uni.setStorageSync('indexHeight', res.windowHeight)
				}
			});
			// #endif
			this.showMask = uni.getStorageSync('showMask')
		},
		onShow() {
			uni.hideTabBar()
			if (!uni.getStorageSync('uploadToken')) {
				// this.getData();
			}
			// this.getUserInfo() //获取用户信息
			// let places = placeMap()
			// if (!uni.getStorageSync('region1')) {
			// 	this.$store.commit('selectCityChange', places['330783'])
			// } else {
			// 	this.$store.commit('selectCityChange', places[uni.getStorageSync('region1').slice(0, 6)])
			// }
			if (uni.getStorageSync('token')) {
				this.$nextTick(() => {
					this.getUserToken()
					if (uni.getStorageSync('userType') == 0) {
						this.$refs.staff.get_user_query();
					}
				})
				// unit.Closure_time().then(v => {
				// 	this.isFengjin = v.data == 0 ? false : v.data.status == 0 ? true : false
				// 	// this.isFengjin=v.data.status==0?true:false//修改过
				// 	if (uni.getStorageSync('yajinItem') != '' && v.data.expireTime != uni.getStorageSync(
				// 			'yajinItem').expireTime) {
				// 		unit.Closure_margin()
				// 	}
				// 	if (this.isFengjin) {
				// 		uni.setStorageSync('date', new Date().toISOString().slice(0, 10))
				// 		this.isShowPw = true
				// 		return
				// 	} else {
				// 		this.isShowPw = false
				// 	}
				// 	if (uni.getStorageSync('FengjinItem')) {
				// 		this.isFengjin = uni.getStorageSync('FengjinItem').status == 0 ? true : false
				// 	}
				// })
			}
			this.word = uni.getStorageSync('word')
			if (this.userType == 0 || !this.token) {
				uni.$once('ShowStaff', () => {
					this.onRefresh()
				})
				if (uni.getStorageSync('shuaxin')) {
					this.onRefresh()
					uni.removeStorageSync('shuaxin')
				}
			}
			uni.$once('ShowStaff', () => {
				this.onRefresh()
			})
			this.onZhou()
			this.isNew = 'none'
			if (uni.getStorageSync('userType') == 0) {
				this.zimuAutoplay = true
				this.isShowNew()
				this.isShowNewfloating()
				if (uni.getStorageSync('token')) {
					this.$nextTick(() => {
						try {
							this.$refs.staff.undoneRefresh()
							this.$refs.staff.refreshMenu()
						} catch (e) {
							//TODO handle the exception
						}
						// this.$refs.staff.get_push_message_records_red_dot()
					})
				}
			}
			//因为抖音小程序对页面的高度没有适配 所以要设置一下底部距离
			// #ifdef MP-TOUTIAO
			uni.getSystemInfo({
				success: res => {
					let indexHeight = uni.getStorageSync('indexHeight')
					console.log('index,onshow', res.windowWidth);
					console.log('index,onshow', res.windowHeight);
					if (res.windowHeight > indexHeight) {
						this.hansBarBottom = res.windowHeight - indexHeight
					}
				}
			});
			// #endif
		},
		onHide() {
			this.zimuAutoplay = false
		},
		onReady() {
			// 协议弹框
			uni.$on('closeFjin', this.closePwPage2)
			if (uni.getStorageSync('userType') == -1) {
				uni.reLaunch({
					url: '/pages/select-identity/select-identity'
				})
				return
			} else if (uni.getStorageSync('userType') == 1) {
				uni.navigateTo({
					url: '/pages/app-employer/send-job/send-job-new',
					animationType: 'fade-in',
					animationDuration: 100
				})
			}
		},
		methods: {
			uploadImgs(url) {
				this.$refs.staff.uploadImgs(url)
			},
			toParents() {
				this.isShowPw = true
			},
			async getUserToken() {
				let res = await this.$fetch(this.$api.get_user_by_token, {}, 'POST')
				// userIdentityStatus, // /用户身份：0 试用零工 1 正式零工 2 金牌晋升期
				// idCardNum, //实名认证
				// frockFlag, //是否购买工装  0 否  1 是  studyFlag 是否学习   ,ensureAccount 保证金
				this.contentMessage = res.data
				let status = res.data.userIdentityStatus
				this.typeVide = 10;
				switch (status) {
					case 0:
						this.video =
							'https://images.linglinggong.net/%E8%AF%95%E7%94%A8%E6%99%8B%E5%8D%87%E5%8A%A9%E6%89%8B%E8%A7%86%E9%A2%91.mp4'
						break
					case 1:
						this.video =
							'https://images.linglinggong.net/%E6%AD%A3%E5%BC%8F%E6%99%8B%E5%8D%87%E5%8A%A9%E6%89%8B%E8%A7%86%E9%A2%91.mp4'
						break
					case 2:
						this.video =
							'https://images.linglinggong.net/%E9%87%91%E7%89%8C%E6%99%8B%E5%8D%87%E5%8A%A9%E6%89%8B%E8%A7%86%E9%A2%91.mp4'
						break
				}
			},
			clickVideo() {
				this.showGrow = true
				this.getUserInfo()
			},
			toClose() {
				this.showGrow = false
			},
			onConfirmClickNew() {
				this.isNew = 'none'
			},
			// 关闭新手
			onCloseNew() {
				this.isNew = 'none'
			},
			//是否展示 新手活动 (一天执行一次)
			async isShowNew() {
				if (!uni.getStorageSync('token')) return
				if (uni.getStorageSync('userType') !== 0) return
				// 直接取缓存 取得的时候是undefined	
				let time = uni.getStorageSync('showNewTime');
				let flag = this.get_nowTime(time);
				console.log(flag, '状态是,是否展示 新手活动index.vue')
				if (flag) {
					// let res = await this.$fetch(this.$api.query_newEmployee, {}, 'GET')
					// console.log(res, '是个什么数据');
					if (uni.getStorageSync('queryNewEmployeeWhether') == 'true') {
						this.isNew = '' //是否显示海报
						this.countNew = uni.getStorageInfoSync('queryNewEmployeeAmount')
					} else {
						this.isNew = 'none' //是否显示海报
					}
					// let that = this;
					// uni.$on('NewEmployeeActivities', function(res) {
					// 	console.log(res, '的数据是对象');
					// 	if (res.whether == 'true') {
					// 		that.isNew = '' //是否显示海报
					// 		that.countNew = res.amount
					// 	} else {
					// 		that.isNew = 'none' //是否显示海报
					// 	}
					// })
					// console.log('执行的是接口111');
				} else {
					// console.log('是否展示 新手活动 (一天执行一次)今日已执行过222222');
					this.isNew = 'none' //是否显示海报
				}
			},
			// 获取当前时间和缓存时间(一天一次)
			get_nowTime(futrue) {
				// 执行这个存储的话就代表今日已展示过，今日不管什么时间段进入都不会执行以下代码
				let nowTime = new Date();
				let futrueTime;
				if (futrue) {
					futrueTime = new Date(futrue); // 缓存时间
				} else {
					// 没有的话就获取今天的时间
					futrueTime = new Date();
					// 缓存时间
					uni.setStorageSync('showNewTime', futrueTime);
				}
				// 当天日期 和 缓存前一天的日期做对比
				if (futrueTime && new Date(futrueTime).getDay() === nowTime.getDay()) {
					return false;
				} else {
					// 如果今日没有执行的话就给存储起来，今日就不会再执行了
					uni.setStorageSync('showNewTime', nowTime)
					return true;
				}
			},
			//是否展示 提示框
			async isShowNewfloating() {
				if (!uni.getStorageSync('token')) return
				if (uni.getStorageSync('userType') !== 0) return
				this.showToop = uni.getStorageSync('NewPeopleRedBag'); // 获取新人红包
				// let that = this;
				// uni.$on('newEmployee_floating', function(data) {
				// 	that.showToop = data;
				// 	// console.log('你好我是是否展示提示框', data);
				// })
				// let res = await this.$fetch(this.$api.query_newEmployee_floating, {}, 'GET')
			},
			//是否展示 周充
			async onZhou() {
				if (!uni.getStorageSync('token')) return
				// let that = this;
				// uni.$on('zhouChong', function(data) {
				// 	console.log('获取的数据是', data, that.isShowPost22)
				// 	if (data) {
				// 		that.isShowPost22 = '' //是否显示海报
				// 	}
				// })
				if (uni.getStorageSync('zhouchong')) {
					that.isShowPost22 = '' //是否显示海报
				}
			},
			//去周冲
			tochong() {
				this.isShowPost22 = 'none'
				uni.navigateTo({
					url: '/pages/chong-award/chong-award',
				})
			},
			// 新雇员活动
			toNew() {
				this.isNew = 'none'
				uni.navigateTo({
					url: '/pages/newStaff/newStaffRedEnvelope'
				})
			},
			// 判断用户是否授权
			getSetting() {
				uni.getSetting({
					success: (res) => {
						if (res.authSetting['scope.userLocation'] != undefined && res.authSetting[
								'scope.userLocation'] != true) { //非初始化进入该页面,且未授权
							uni.showModal({
								title: '是否授权当前位置',
								content: '将获取您的具体位置，用于根据距离展示距离您更近的任务',
								success: res => {
									if (res.cancel) {
										uni.showToast({
											title: '授权失败',
											icon: 'none',
											duration: 1000
										})
									} else if (res.confirm) {
										this.openSet()
									}
								}
							})
						} else {
							// #ifdef MP-WEIXIN
							this.get_current_location()
							// #endif
						}
					}
				})
			},
			/* 打开设置 */
			openSet() {
				uni.openSetting({
					success: dataAu => {
						if (dataAu.authSetting["scope.userLocation"] == true) {
							uni.showToast({
								title: '授权成功',
								icon: 'success',
								duration: 1000
							})
							// #ifdef MP-WEIXIN
							this.get_current_location()
							// #endif
						} else {
							uni.showToast({
								title: '授权失败',
								icon: 'none',
								duration: 1000
							})
						}
					}
				})
			},
			// 获取用户当前的经纬度
			get_current_location() {
				uni.getLocation({
					// #ifdef MP-WEIXIN
					type: 'gcj02',
					// #endif
					success: (res) => {
						// console.log('获取经纬度~~')
						uni.setStorageSync('location', [res.latitude, res.longitude])
						this.getAdcode(res.latitude, res.longitude)
					}
				})
				setInterval(() => {
					uni.getLocation({
						// #ifdef MP-WEIXIN
						type: 'gcj02',
						// #endif
						success: (res) => {
							// console.log('获取经纬度~~')
							uni.setStorageSync('location', [res.latitude, res.longitude])
							this.getAdcode(res.latitude, res.longitude)
						}
					})
				}, 120000)
			},
			// 由经纬度查询街道的行政代码
			getAdcode(lat, lng) {
				uni.request({
					url: 'https://restapi.amap.com/v3/geocode/regeo?parameters',
					data: {
						key: 'd73cc951a96637a251a9a2446b48ce9c',
						location: lng + ',' + lat
					},
					success: res => {
						uni.setStorageSync('currentAddress', res.data.regeocode.formatted_address)
						let region = res.data.regeocode.addressComponent.towncode.slice(0, 9)
						uni.setStorageSync('region', region)
						uni.setStorageSync('region1', region)
						if (uni.getStorageSync('token')) {
							// this.upd_user(lat, lng, region) ////更新用户位置
						}
					}
				})
			},
			//更新用户位置
			async upd_user(lat, lng, region) {
				//经纬度保留6位小数
				lat = lat.toFixed(6)
				lng = lng.toFixed(6)
				region = region.slice(0, 9)
				console.log('更新用户位置', lat, lng, region)
				let res = await this.$fetch(this.$api.upd_user, {
					lat: lat,
					lng: lng,
					region: region
				}, 'POST')
				console.log('更新用户位置res', res)
			},
			closePwPage2() {
				this.isShowPw = false
				this.isFengjin = false
			},
			onRefresh() {
				this.$refs.staff.refresh()
			},
			on_order_detail() {
				var pages = getCurrentPages() // 获取栈实例
				var page = pages[pages.length - 2]
				console.log(pages)
				if (page.route.includes('/pages/order-detail/order-detail')) {
					this.$refs.staff.refresh()
				}
			},
			on_job_detail() {
				var pages = getCurrentPages() // 获取栈实例
				var page = pages[pages.length - 2]
				console.log(pages)
				if (page.route.includes('/p/pages/job-detail/job-detail')) {
					this.$refs.staff.refresh()
				}
			},
			// 用户同意协议
			onConfirmClick() {
				uni.setStorageSync('first-is', true)
				if (uni.getStorageSync('userType') == 1) {
					uni.navigateTo({
						url: '/pages/app-employer/send-job/send-job-new',
						animationType: 'fade-in',
						animationDuration: 100
					})
				}
			},
			// 海报点击x，取消
			onConfirmClicks: function() {
				//	console.log("wwwwwwwwwwwww")
				this.isShowPost22 = 'none' //是否显示海报
				this.isShowPost = 'none' //是否显示海报
				uni.setStorageSync('date', new Date().toISOString().slice(0, 10))
				if (uni.getStorageSync('userType') == 1) {
					uni.navigateTo({
						url: '/pages/app-employer/send-job/send-job-new',
						animationType: 'fade-in',
						animationDuration: 100
					})
				}
			},
			// 用户不同意协议
			onCancelClick() {
				plus.runtime.quit();
			},
			//弹窗点击事件
			OnPopupWatch() {
				console.log(this.PopupWatchImg[1], 789)
				if (this.PopupWatchImg[1] === "跳转路径") {
					plus.share.getServices(res => {
						let sweixin = null;
						for (let i in res) {
							if (res[i].id == 'weixin') {
								sweixin = res[i];
							}
						}
						//唤醒微信小程序
						if (sweixin) {
							sweixin.launchMiniProgram({
									id: uni.getStorageSync('UUID'),
									type: 2, //小程序版本  0-正式版； 1-测试版； 2-体验版。
									path: 'pages/wechat/chongFen/chongFen?isApp=true' //小程序的页面,用传的参数在小程序接值判断跳转指定页面
								},
								//目标小程序点击返回App后执行的回调,在此接收binderror="launchAppError"的参数
								res => {
									console.log(res)
								}, err => {
									console.log(err)
								});
						}
					});
				} else {
					console.log(this.PopupWatchImg[1], 123)
					uni.navigateTo({
						url: `/${this.PopupWatchImg[1]}`
					})
					this.isShowPost = 'none'
					uni.setStorageSync('date', new Date().toISOString().slice(0, 10))
				}
			},
			// 海报点击去发布
			handleClosePost() {
				this.isShowPost = 'none' //是否显示海报
				uni.setStorageSync('date', new Date().toISOString().slice(0, 10))
				uni.setStorageSync("userd", "5")
			},
			// 获取当前用户信息
			async getUserInfo() {
				let res = await this.$fetch(this.$api.get_current_user, {}, 'GET')
				this.vipFlag = res.data.user.vipFlag
				if (res.data.payPwdFlag) {
					uni.setStorageSync('isHavePayPassword', true)
				} else {
					uni.setStorageSync('isHavePayPassword', false)
				}
				if (res.code) return
				// 整理数据,res.data.user为空，则改为""
				Object.getOwnPropertyNames(res.data.user).forEach(function(key) {
					res.data.user[key] = res.data.user[key] == null ? '' : res.data.user[key]
				})
				res.data.user.avatar = res.data.user.avatar ? res.data.user.avatar : ''
				res.data.user.sex = res.data.user.sex ? res.data.user.sex.toString() : '0' //讲数字变成字符串
				uni.setStorageSync('userInfo', res.data)
				uni.setStorageSync('userType', res.data.userType)
				uni.setStorageSync('userId', res.data.user.userId)
				uni.setStorageSync("level", res.data.user.level) //用户等级
				let userInfo = res.data
				let userType = res.data.userType
				console.log('-----', userType)
				this.userType = userType
				this.userInfo = userInfo
				if (this.userType == 1) {
					uni.hideTabBar()
				}
				// 雇员且休息状态0开启接单
				if (userType == 0 && userInfo.userJobStatus == 0) {
					// this.orderReceive()
				}
				// 切换底部导航栏
				this.setTabr()
				// 获取海报
				this.getPostUrl()
			},
			// 接单
			async orderReceive() {
				let res = await this.$fetch(this.$api.upd_user_job_status, {
					status: 2
				}, 'POST')
				if (res.code) return
			},
			// 切换底部导航栏
			setTabr() {
				if (this.userType2 == 1) {
					this.isShowPost = 'none'
					uni.hideTabBar()
				} else if (this.userType2 == 0) {
					// uni.showTabBar()
					setTimeout(() => {
						uni.setTabBarItem({
							index: 0,
							text: '零工',
							"iconPath": "static/tab-bar/1.png",
							"selectedIconPath": "static/tab-bar/2.png",
						})
						uni.setTabBarItem({
							index: 1,
							text: '接单',
							"iconPath": "static/tab-bar/3.png",
							"selectedIconPath": "static/tab-bar/4.png",
						})
					}, 1000)
					if (new Date().toISOString().slice(0, 10) != uni.getStorageSync('date')) {
						if (uni.getStorageSync('userType') == 1) {
							this.isShowPost = 'none'
						} else {
							this.getStaffPopupWatch()
							setTimeout(() => {
								this.isShowPost = ''
							}, 800)
						}
					}
				} else {
					// uni.showTabBar()
				}
			},
			//获取雇主弹窗
			async getBossPopupWatch() {
				let res = await this.$fetch(this.$api.property_list_by_type, {
					type: 1
				}, 'POST')
				if (res.code) return uni.showToast({
					title: res.msg,
					icon: 'none'
				})
				this.PopupWatchImg = res.data.boss_popup_watch.split(",")
			},
			//获取雇员弹窗
			getStaffPopupWatch() {
				this.pagePath = uni.getStorageSync('property_list_by_type').Systememployee.split(',')[1]
				this.PopupWatchImg = uni.getStorageSync('property_list_by_type').staff_popup_watch.split(",")
			},
			//获取新雇员活动弹窗
			getNewStaffPopupWatch() {
				this.PopupWatchImg = uni.getStorageSync('property_list_by_type').new_staff_popup_watch.split(",")
				if (uni.getStorageSync('userInfo').receivenumstatus == 0) {
					Registration_activities()
				}
				//console.log('sdsadsa',this.$refs.my_post) 
			},
			// 获取海报
			getPostUrl() {
				let userInfo = uni.getStorageSync('userInfo')
				let qrcode = uni.getStorageSync('qrcode')
				let avatar = uni.getStorageSync('imgPath') + userInfo.user.avatar
				let userName = userInfo.user.userName
			},
			// 获取配置数据
			async getData() {
				console.log('进入');
				// 如果有token,获取二维码
				if (uni.getStorageSync('token')) {
					let res1 = await this.$fetch(this.$api.get_user_qrcode, {}, 'GET')
					uni.setStorageSync('qrcode', baseURL + res1.data.path)
					console.log('获取二维码', uni.getStorageSync('qrcode'))
				}
				let res5 = await this.$fetch(this.$api.get_qiniu_token, {}, 'POST')
				uni.setStorageSync('uploadToken', res5.msg)
			},
			// 获取用户当前的经纬度
			get_current_location() {
				uni.getLocation({
					type: 'gcj02',
					success: (res) => {
						uni.setStorageSync('location', [res.latitude, res.longitude])
						this.getAdcode(res.latitude, res.longitude)
					}
				})
			},
			closePwPage() {
				this.isShowPw = false
				if (uni.getStorageSync('FengjinItem')) {
					this.isFengjin = uni.getStorageSync('FengjinItem').status == 0 ? true : false
				}
			},
		},
	}
</script>
<style>
	page {
		background-color: #FFF;
	}
</style>
<style scoped lang="less">
	page {
		background-color: #FFF;
	}

	.container {
		&>.modal {
			z-index: 9;
			width: 100vw;
			height: calc(100vh - var(--status-bar-height) + 192rpx);
			pointer-events: none;
			background: transparent;
			transition: all .3s;
			position: fixed;
			top: 0;
			padding-top: calc(var(--status-bar-height) + 16rpx);
			z-index: 3333;
			background-color: #FFFFFF;

			&.show {
				display: flex;
				width: 100%;
				height: 100%;
				top: 0rpx;
				background: rgba(0, 0, 0, 0.40);
				pointer-events: auto;
				text-align: center;
				z-index: 9999;
			}

			.my-post {
				// border: 1px solid  #4CD964;
				position: absolute;
				top: 0rpx;
				left: 50%;
				top: 50%;
				transform: translate(-50%, -50%);
				width: 400rpx;
				height: 400rpx;

				.bg {
					width: 400rpx;
					height: 400rpx;
					display: inline-block;
					animation: zoomInDown 1s ease-in 0s 1;
				}

				.bgNew {
					width: 100%;
					height: 778rpx;
					display: inline-block;
					animation: zoomInDown 1s ease-in 0s 1;
					background: url('https://images.linglinggong.net/static/icon3/xinrengongshihongbao/newS.png')center center/100% no-repeat;

					&>text {
						font-size: 234rpx;
						color: #FFF8AE;
						display: block;
						margin-top: 136rpx;
						height: 600rpx;
					}
				}
			}

			.close {
				position: absolute;
				left: -30rpx;
				top: -20rpx;
				width: 70rpx;
				height: 70rpx;
				z-index: 111;
			}
		}
	}

	@keyframes zoomInDown {
		from {
			opacity: 0;
			-webkit-transform: scale3d(0.1, 0.1, 0.1) translate3d(0, -1000px, 0);
			transform: scale3d(0.1, 0.1, 0.1) translate3d(0, -1000px, 0);
			-webkit-animation-timing-function: cubic-bezier(0.55, 0.055, 0.675, 0.19);
			animation-timing-function: cubic-bezier(0.55, 0.055, 0.675, 0.19);
		}

		60% {
			opacity: 1;
			-webkit-transform: scale3d(0.475, 0.475, 0.475) translate3d(0, 60px, 0);
			transform: scale3d(0.475, 0.475, 0.475) translate3d(0, 60px, 0);
			-webkit-animation-timing-function: cubic-bezier(0.175, 0.885, 0.32, 1);
			animation-timing-function: cubic-bezier(0.175, 0.885, 0.32, 1);
		}
	}

	.toops {
		width: 110rpx;
		height: 140rpx;
		background: url('https://images.linglinggong.net/static/icon3/xinrengongshihongbao/newBg.png') center center/cover no-repeat;
		position: fixed;
		bottom: 60%;
		right: 30rpx;
		z-index: 98;
		z-index: 66;
		text-align: center;
		overflow: hidden;
		transform-origin: center bottom;
		animation: zwyShake 2s 0.5s ease-out infinite;

		&>text {
			margin-top: 30rpx;
			font-size: 36rpx;
			font-weight: bold;
			color: #FFF8AE;
			display: block;
		}
	}

	@keyframes zwyShake {
		0% {
			transform: rotate(0deg);
			transition-timing-function: cubic-bezier(0.215, .61, .355, 1);
		}

		10% {
			transform: rotate(-12deg);
			transition-timing-function: cubic-bezier(0.215, .61, .355, 1);
		}

		20% {
			transform: rotate(12deg);
			transition-timing-function: cubic-bezier(0.215, .61, .355, 1);
		}

		28% {
			transform: rotate(-10deg);
			transition-timing-function: cubic-bezier(0.215, .61, .355, 1);
		}

		36% {
			transform: rotate(10deg);
			transition-timing-function: cubic-bezier(0.755, .5, .855, .06);
		}

		42% {
			transform: rotate(-8deg);
			transition-timing-function: cubic-bezier(0.755, .5, .855, .06);
		}

		48% {
			transform: rotate(8deg);
			transition-timing-function: cubic-bezier(0.755, .5, .855, .06);
		}

		52% {
			transform: rotate(-4deg);
			transition-timing-function: cubic-bezier(0.755, .5, .855, .06);
		}

		56% {
			transform: rotate(4deg);
			transition-timing-function: cubic-bezier(0.755, .5, .855, .06);
		}

		60% {
			transform: rotate(0deg);
			transition-timing-function: cubic-bezier(0.755, .5, .855, .06);
		}

		100% {
			transform: rotate(0deg);
			transition-timing-function: cubic-bezier(0.215, .61, .355, 1);
		}
	}

	// 晋升助手
	.helper {
		width: 152rpx;
		height: 58rpx;
		border-radius: 60rpx 0rpx 0rpx 60rpx;
		position: fixed;
		right: 0;
		bottom: 30rpx;
		z-index: 99;
		color: #fff;
		font-size: 24rpx;
		background: linear-gradient(135deg, #00B554 0%, #00B682 100%);
		box-shadow: 4rpx 6rpx 8rpx 2rpx rgba(29, 110, 45, 0.4);
		text-align: center;
		line-height: 58rpx;
	}
</style>